import { Entity, Column, PrimaryGeneratedColumn, CreateDateColumn, UpdateDateColumn } from 'typeorm';
import { ApiProperty } from "@nestjs/swagger";

@Entity({ name: 'product' })
export class ProductEntity {

    @PrimaryGeneratedColumn()
    @ApiProperty({ description: '' })
    id: number

    @Column()
    @ApiProperty({ description: '商品名称' })
    productName: string

    @Column()
    @ApiProperty({ description: '商品描述' })
    desc: string

    @Column()
    @ApiProperty({ description: '是否热门' })
    isHot: number

    @Column()
    @ApiProperty({ description: '商品详情' })
    detail: string

    @Column()
    @ApiProperty({ description: '销售价' })
    salePrice: number

    @Column()
    @ApiProperty({ description: '原价' })
    originalPrice: number

    @Column()
    @ApiProperty({ description: '主图' })
    headImg: string

    @Column()
    @ApiProperty({ description: '轮播图' })
    carouselImg: string

    @Column()
    @ApiProperty({ description: '分类id' })
    cateId: number

    @CreateDateColumn()
    @ApiProperty({ description: '创建时间' })
    createdTime: Date

    @UpdateDateColumn()
    @ApiProperty({ description: '更新时间' })
    updatedTime: Date

    @Column()
    @ApiProperty({ description: '状态（0 下架 1 上架）' })
    status: number

    @Column()
    @ApiProperty({ description: '库存' })
    stock: number

    @Column()
    @ApiProperty({ description: '版本号' })
    version: number

}